package File_IO;

import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: DELL
 * Date: 2023-02-07
 * Time: 17:30
 */
public class IODemo6 {
    public static void main(String[] args) {
        //Scanner scanner = new Scanner(System.in);
        // 此处 System.in 是一个流对象

        try (InputStream inputStream = new FileInputStream("e:/test.txt")){

            Scanner scanner = new Scanner(inputStream);
            // 此时读取内容就是从文件中读取了
            scanner.next();

        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }
}
